<?php
namespace App\Models\Pdf;

use App\Models\Category\Category;
use Illuminate\Database\Eloquent\Model;
use Dcat\Admin\Traits\HasDateTimeFormatter;
use Illuminate\Database\Eloquent\Relations;

class PdfImage extends Model
{
    use HasDateTimeFormatter;

    protected $fillable = ['category_id', 'url', 'width', 'height', 'page', 'real_page'];

    public function coordinate(): Relations\HasMany
    {
        return $this->hasMany(PdfImageCoordinate::class);
    }

    public function category(): Relations\BelongsTo
    {
        return $this->belongsTo(Category::class);
    }
}
